473,435 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,435 software developers and data experts.

Simple context menu problem

What's wrong with the context menu?

I have created one for the DataGrid control and showing it like this:

private void dataGrid_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if( e.Button == MouseButtons.Right)
{
if( dataGrid.ContextMenu != null )
dataGrid.ContextMenu.Show(dataGrid, new Point(e.X, e.Y) );
}
}

The menu is displayed but I need to click TWICE to dismiss it!
Is it intended to be like that?
Nov 16 '05 #1
2 4481
Never mind,
I just removed the right mouse click handler and everything is fine.
"Striped" <skovbasa[aatt]insycom.net> wrote in message
news:eX**************@tk2msftngp13.phx.gbl...
What's wrong with the context menu?

I have created one for the DataGrid control and showing it like this:

private void dataGrid_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if( e.Button == MouseButtons.Right)
{
if( dataGrid.ContextMenu != null )
dataGrid.ContextMenu.Show(dataGrid, new Point(e.X, e.Y) );
}
}

The menu is displayed but I need to click TWICE to dismiss it!
Is it intended to be like that?

Nov 16 '05 #2
"Striped" <skovbasa[aatt]insycom.net> wrote in message
news:eX**************@tk2msftngp13.phx.gbl...
What's wrong with the context menu?

I have created one for the DataGrid control and showing it like this:

private void dataGrid_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if( e.Button == MouseButtons.Right)
{
if( dataGrid.ContextMenu != null )
dataGrid.ContextMenu.Show(dataGrid, new Point(e.X, e.Y) );
}
}

The menu is displayed but I need to click TWICE to dismiss it!
Is it intended to be like that?


I believe that once the menu is assigned to the DataGrid's ContextMenu
property it will automatically be popped up in response to a right-mouse
click, so you don't need to handle the MouseUp event and show the menu
yourself.(I admit that this is NOT what the online help says, but it seems
to work!)

Chris Jobson
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Eddie de Bear | last post by:
Hi, A project I am working on has a requirement for dynamic menus. For the most part this works really well. The menus I'm creating a based on files and directories, so naturally the menu...
4
by: Mohit Gupta | last post by:
Hi all, Lately I have been working on an application in VB .net CF for Pocket PC device. I have a small question about Context Menu. When I try to close the window after context menu is poped...
2
by: Eric | last post by:
I implemented owner drawing on the main and context menus of my main form. It works fine. There is also a notify icon control that has a context menu. When the icon is in the status bar, it...
0
by: VP | last post by:
G'day folks, well i am attempting to get an understanding on how to create the menuitems in a context menu on the fly. So far I have managed to actually achieve the menu items being created for...
2
by: Dino M. Buljubasic | last post by:
I have several context menus added to my form. The form is displaying items in listviews connected to the context menus. When I click on an item in a list view, a popup context menu shows allowing...
0
by: tony.spalding | last post by:
I'm having a problem trying to add a link to my add-in to a context menu. I'm trying to add it to the context menu that you get when you right click on a stored procedure within the Server...
4
by: Fred | last post by:
Hi, I have a list box with a context menu. When I right click the menu appears as expected. However when I select an option on the context menu the menu does not close. The click event on the...
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
3
by: Poggs | last post by:
Hi everyone, I used the pattern for Shell Extensions for Context menu from Dino Esposito's article. However I implemented it in more than one application and it seems that those two right click...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.